<template>
  <div class="body">
    <div class="background">
      <div class="rotate">
        <div class="sphere">
          <span></span>
          <span></span>
          <span></span>
          <span></span>
          <span></span>
          <span></span>
        </div>
        <div class="sphere">
          <span></span>
          <span></span>
          <span></span>
          <span></span>
          <span></span>
          <span></span>
        </div>
        <div class="sphere">
          <span></span>
          <span></span>
          <span></span>
          <span></span>
          <span></span>
          <span></span>
        </div>
        <div class="sphere">
          <span></span>
          <span></span>
          <span></span>
          <span></span>
          <span></span>
          <span></span>
        </div>
      </div>
    </div>
  </div>
</template>



<style scoped>
.body {
  margin: 0;
  padding: 0;
  background: #000;
}

.background {
  position: fixed;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* 居中并开启3d效果 */
.background .rotate {
  position: absolute;
  top: calc(50% - 200px);
  left: calc(50% - 200px);
  width: 400px;
  height: 400px;
  transform-style: preserve-3d;
  animation: rotate 20s linear infinite;
  zoom: 6;
}

@keyframes rotate {
  0% {
    transform: rotateX(0deg) rotateY(0deg);
  }
  100% {
    transform: rotateX(360deg) rotateY(360deg);
  }
}

.background .rotate .sphere,
.background .rotate .sphere span {
  position: absolute;
  top: 0px;
  left: 0px;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

.background .rotate .sphere span {
  background: radial-gradient(#ccc, #fff);
  border-radius: 50%;
}

.background .rotate .sphere:nth-child(2) {
  transform: rotate(90deg);
}
.background .rotate .sphere:nth-child(3) {
  transform: rotate(45deg);
}
.background .rotate .sphere:nth-child(4) {
  transform: rotate(-45deg);
}

.background .rotate .sphere span:nth-child(1) {
  transform: rotateY(0deg);
}
.background .rotate .sphere span:nth-child(2) {
  transform: rotateY(30deg);
}
.background .rotate .sphere span:nth-child(3) {
  transform: rotateY(60deg);
}
.background .rotate .sphere span:nth-child(4) {
  transform: rotateY(90deg);
}
.background .rotate .sphere span:nth-child(5) {
  transform: rotateY(120deg);
}
.background .rotate .sphere span:nth-child(6) {
  transform: rotateY(150deg);
}
</style>
